# -*- coding: utf-8 -*-
from pymongo.objectid import ObjectId as _id

from common import BaseHandler 
class HomeHandler(BaseHandler): 
    def get(self):  
        self.render('myspace/myspace.html')
class CommentHandler(BaseHandler): 
    def get(self):  
        self.render('myspace/comment.html')
    
class TestHandler(BaseHandler):  
    def get(self):  
        self.render('myspace/test.html')

uid_name_mapping = {
    'hong': u'红雷鸣',
}

import time 
post = {
    'text': u'文章内容',
    'at': time.time(),
    'uid': 'hong',
    'acl':[_id(),_id()],
    'type': 0, #0--weibo, 1--news, 2--discuss
    'comments':[
        {'text': u'回复内容', 'uid': 'leiming', 'at': time.time(),},
    ],
} 

user = { 
    'follows': [
        {'id': 'hong1', 'name':'user1'},
        {'id': 'hong2', 'name':'user2'}],
    'fans': [
        {'id': 'hong3', 'name':'user3'},
        {'id': 'hong4', 'name':'user4'}],
    'fans_cnt': 2,
    'follows_cnt': 2,
    'score': 802,
    'signature': u'速度与激情，轻量级良民一枚',
    
    'id': 'hong',
    'name': u'洪磊明',
    'pwd': '123456',
    
    'circles': [
        {'id': 'c001', 'name': u'投资圈1'},
        {'id': 'c002', 'name': u'投资圈2'}],  
    
}
myspace = {
    'owner': {'id': 'hong', 'name': u'洪磊明'},
    'stat': {'today': 0, 'lastday': 0, 'lastweek': 0, 'lastmonth': 0, 'all': 0},
    'visitors': [
        {'id': 'hong3', 'name':'user3', 'time': 0},
        {'id': 'hong4', 'name':'user4', 'time': 0}],
}
 
     
handlers = [ 
    ('/myspace/test', TestHandler), 
    ('/myspace/cmt', CommentHandler),    
    ('/myspace', HomeHandler),        
] 